
SET( LUA_Font_H
			config.h
			luaFont.h
			#GLFont.h
			)
SET( LUA_Font_SRC ./src/luaFont.cpp
						global.cpp
						#GLFont.cpp
						#GLFontManager.cpp
						./src/luaFont.cpp
)


INCLUDE_DIRECTORIES(  ${LUAEx_SOURCE_DIR} )
INCLUDE_DIRECTORIES(  ${LUA_INCLUDE_DIR} )
INCLUDE_DIRECTORIES(  ${MYLIB_DIR} )
INCLUDE_DIRECTORIES(  ${SOL2_INCLUDE_DIR} )
INCLUDE_DIRECTORIES(  ${Boost_INCLUDE_DIR} )
INCLUDE_DIRECTORIES(  ${MYLIB_LOG_INCLUDE_DIR} )
INCLUDE_DIRECTORIES(  ${GLFont_INCLUDE_DIR} )

INCLUDE_DIRECTORIES(  ${ftgl_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(  ${FREETYPE_INCLUDE_DIR_freetype2} )
INCLUDE_DIRECTORIES(  ${FREETYPE_INCLUDE_DIR_ft2build} )
INCLUDE_DIRECTORIES(  ${FREETYPE_INCLUDE_DIR} )

set(LUA_Font_ALLFILES ${LUA_Font_H} ${LUA_Font_SRC})
add_compile_options(-liconv)

if(LUA_Font_STATIC_LIB)
	ADD_LIBRARY(luaFont STATIC ${LUA_Font_ALLFILES})
else(LUA_Font_STATIC_LIB)
	ADD_LIBRARY(luaFont SHARED ${LUA_Font_ALLFILES})
    if(WIN32)
        add_definitions( -DLUA_Font_DLL )
    endif(WIN32)
endif(LUA_Font_STATIC_LIB)

add_dependencies(luaFont luaState)

if(MSVC)
    set(luaState_LIBRARY luaState)
    set(GLFont_LIBRARY GLFont)
endif()

add_definitions(-DUNICODE -D_UNICODE)

target_link_libraries(luaFont ${luaState_LIBRARY} ${ftgl_LIBRARY} ${GLFont_LIBRARY})


target_link_libraries(luaFont ${LUA_LIBRARY} ${OPENGL_LIBRARIES})
target_link_libraries(luaFont ${Boost_FILESYSTEM_LIBRARY}
							   ${Boost_SYSTEM_LIBRARY} 		
    						   ${Boost_REGEX_LIBRARY}
    						   ${Boost_LOCALE_LIBRARY}
    						)
target_link_libraries(luaFont ${MYLIB_LOG_LIBRARY}  ${EXTERNAL_LIBRARIES})


SET_TARGET_PROPERTIES(luaFont PROPERTIES PREFIX "")
collect_library(luaFont)
